#!/usr/bin/python

def listSum(number):
    if not number:
        return 0
    else:
        (f, rest) = number
        return f + listSum(rest)

mylist = (1, (2, (3, None)))
total = listSum(mylist)

print mylist
print total
